package housing.task3.dto;

import housing.task3.dto.PK.HsWorkscalePk;

import java.io.Serializable;

public class HsWorkscale implements Serializable {
    /**
     * This attribute maps to the column workScale_id in the HS_WorkScale table.
     */
    protected int workscaleId;

    /**
     * This attribute maps to the column name in the HS_WorkScale table.
     */
    protected String name;

    /**
     * Method 'HsWorkscale'
     */
    public HsWorkscale() {
    }

    /**
     * Method 'getWorkscaleId'
     *
     * @return int
     */
    public int getWorkscaleId() {
        return workscaleId;
    }

    /**
     * Method 'setWorkscaleId'
     *
     * @param workscaleId
     */
    public void setWorkscaleId(int workscaleId) {
        this.workscaleId = workscaleId;
    }

    /**
     * Method 'getName'
     *
     * @return String
     */
    public String getName() {
        return name;
    }

    /**
     * Method 'setName'
     *
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Method 'equals'
     *
     * @param _other
     * @return boolean
     */
    public boolean equals(Object _other) {
        if (_other == null) {
            return false;
        }

        if (_other == this) {
            return true;
        }

        if (!(_other instanceof HsWorkscale)) {
            return false;
        }

        final HsWorkscale _cast = (HsWorkscale) _other;
        if (workscaleId != _cast.workscaleId) {
            return false;
        }

        if (name == null ? _cast.name != name : !name.equals(_cast.name)) {
            return false;
        }

        return true;
    }

    /**
     * Method 'hashCode'
     *
     * @return int
     */
    public int hashCode() {
        int _hashCode = 0;
        _hashCode = 29 * _hashCode + workscaleId;
        if (name != null) {
            _hashCode = 29 * _hashCode + name.hashCode();
        }

        return _hashCode;
    }

    /**
     * Method 'createPk'
     *
     * @return HsWorkscalePk
     */
    public HsWorkscalePk createPk() {
        return new HsWorkscalePk(workscaleId);
    }

    /**
     * Method 'toString'
     *
     * @return String
     */
    public String toString() {
        StringBuffer ret = new StringBuffer();
        ret.append("housing.task3.dto.HsWorkscale: ");
        ret.append("workscaleId=" + workscaleId);
        ret.append(", name=" + name);
        return ret.toString();
    }

}
